﻿using System;
using System.Collections.Generic;
using Jayden.Dll.Web.HtmlControls.Descriptions;
using Jayden.Dll.Web.HtmlControls.Generics;
using Jayden.Dll.Web.HtmlControls.Interfaces;

namespace Jayden.Dll.Web.HtmlControls
{
	public class ColGroup : HtmlElement, WithSpan
	{
		public ColGroup() : base(ColGroupDescription.Instance) { }

		public uint? Span { get { return GetAttributeUint("span"); } set { SetAttribute("span", value); } }
		public Col AddCol() { return AddControl<Col>(); }
	}
	public class ColGroupDescription : HtmlElementDescription
	{
		public static readonly ColGroupDescription Instance = new ColGroupDescription();
		private ColGroupDescription() : base("colgroup") { }
		public override Type ControlType { get { return typeof(ColGroup); } }
		public override string Description { get { return "group of one or more columns in the table that is its parent."; } }
		public override bool AllowInnerText { get { return false; } }
		public override IEnumerable<HtmlElementDescription> PermittedElements { get { yield return ColDescription.Instance; } }
		public override IEnumerable<HtmlElementDescription> PermittedParents { get { yield return TableDescription.Instance; } }
	}
}
